<!DOCTYPE html>
<%@page import="cn.school.service.GradeService"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<%@ page language="java" contentType="text/html; charset=utf-8"%>
<%@ page import="cn.school.entity.*,java.util.*,service.*,java.text.*"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>修改学生信息</title>
<style type="text/css">
form {
	border: 1px solid black;
}
</style>
<script type="text/javascript" src="js/jquery-3.4.1.min.js"></script>
</head>
<body>
	<%@include file="/checkLogin.jsp"%>
	
	<form action="doUpdatestudent.jsp" method="post" enctype="multipart/form-data">
		<p>
			<label>学号:</label> <input type="text" name="stuno"
				readonly="readonly"  value="${stu.stuno }" />
		</p>
		<p>
			<label>姓名:</label> <input type="text" name="sname"
				required="required" value="${stu.sname }" />
		</p>
		<p>
			<label>性别:</label> <input type="radio" required name="sex" value="男" />男
			<input type="radio" required name="sex" value="女" />女 <input
				type="radio" required name="sex" value="妖" /> 妖

			<%-- 男：<input type="radio" required name="sex" value="男" <%=s.getSex().equals("男")?"checked":""%> />
	女：<input type="radio" required name="sex" value="女" <%=s.getSex().equals("女")?"checked":""%>  />
	妖：<input type="radio" required name="sex" value="妖" <%=s.getSex().equals("妖")?"checked":"" %> />	 --%>
		</p>
		<p>
			<label>电话:</label> <input type="text" name="telephone"
				required="required" value="${stu.telephone }" />
		</p>
		<p>
			<label>qq:</label> <input type="text" name="qq"
				value="${stu.qq }" />
		</p>
		<p>
			<label>微信:</label> <input type="text" name="wechat"
				value="${stu.wechat }" />
		</p>

		<p>
			<label>年级:</label>
			 
			<select name="gradeid"> 
				<c:forEach items="${grades}" var="g">
				<option value="${g.id}">${g.getGname()}</option>
				</c:forEach>
			</select>
 
		</p>
		<p>
			<label>入学日期:</label> <input type="text" name="enterdate"
				value='<fmt:formatDate value="${stu.enterdate }" pattern="yyyy-MM-dd"/>' />
		</p>
		<p>
			<label>来自哪个城市:</label> <input type="text" name="fromcity"
				required="required" value="${stu.fromcity }" />
		</p>
		<p>
			<label>生日:</label> <input type="text" name="birthday"
				required="required"
				value="<fmt:formatDate value="${stu.birthday}" pattern="yyyy-MM-dd"/>" />
		</p>
		<p>
			<label>地址:</label> <input type="text" name="address"
				value="${stu.address}" />
		</p>
		<p>
			<label>密码:</label> <input type="text" name="pass" required="required"
				value="${stu.pass}" />
		</p>
		<p>
			<label>身份证照片</label> <input type="file" name="idcardpic"
				placeholder="更换图片" /> <img src="img/${stu.idcardpic }"
				alt="没有图片" height="200px" width="200px" />
		</p>
		<p>
			<button type="submit" class="page-btn" name="save">确认</button>
		</p>
	</form>

</body>
<script>
 $(function(){
	  $(":radio[name=sex][value='${stu.sex }']").prop("checked",true);
	  $("select[name=gradeid]").val('${stu.gradeid}');
	});
</script>
</html>
